package companyTest.xiecheng;

import java.util.Arrays;
import java.util.Scanner;

public class Main3 {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        String s=in.next();
        char chars[]=s.toCharArray();
        StringBuilder sb=new StringBuilder();
        int count=0;
        for (int i = 0; i < chars.length; i++) {
           char c=chars[i];
           if (c=='1')count++;
        }
        if (count%2==1){
            for (int i = 0; i < chars.length; i++) {
                char c=chars[i];
                if (c=='?'){
                    if ((i==0||chars[i-1]!='1')&&(i==chars.length-1||chars[i+1]!='1')){
                        chars[i]=1;
                        break;
                    }
                }
            }
        }
        boolean flag=true;
        for (int i = 0; i < chars.length; i++) {
            char c=chars[i];
            if (c=='?'){
                if ((i==0||chars[i-1]!='2')&&(i==chars.length-1||chars[i+1]!='2')){
                    chars[i]='2';
                }else if ((i==0||chars[i-1]!='0')&&(i==chars.length-1||chars[i+1]!='0')){
                    chars[i]='0';
                }else {
                    flag=false;
                }
            }
            sb.append(chars[i]);
        }
        if (flag){
            System.out.println(sb.toString());
        }else {
            System.out.println(-1);
        }
    }



}
